let tagsApp = new Vue({
    el:'#tagsApp',
    data:{
        category: {},
        user:''
    },
    methods:{
        loadTags:function () {
            console.log('执行了 loadTags');
            axios({
                url:"/category",
                method:'get'
            }).then(function(response){
                console.log(response.data);
                tagsApp.category = response.data;
            })
        },
        getUser:function () {
            //获取当前登录的用户对象
            axios({
                url:"/user/currentUser",
                method:'get'
            }).then(function (response) {
                tagsApp.user = response.data;
            })
        }
    },
    created:function () {
        this.loadTags();
        this.getUser();
    }
});